import service from "../index";

export const applyPersonHistory = (data) => {
  return service({
    method: "POST",
    url: "/apt/approve/queryApprove",
    data,
  });
};

export const allHTQD = (data) => {
  return service({
    method: "POST",
    url: "/apt/vendorMap/queryContractDetail",
    data,
  });
};

export const allProjectCodeData = (data) => {
  return service({
    method: "POST",
    url: "/apt/emp/queryEmpCode",
    data,
  });
};

export const allWorkCodeData = (data) => {
  return service({
    method: "POST",
    url: "/apt/emp/queryEmpCode",
    data,
  });
};

export const DC = (data) => {
  return service({
    method: "POST",
    url: "/apt/emp/exportEmpTotalInfo",
    data,
  });
};

export const submitPersonWH = (data) => {
  return service({
    method: "POST",
    url: "/apt/emp/updateEmp",
    data,
  });
};

export const submitPersonTable = (data) => {
  return service({
    method: "POST",
    url: "/apt/approve/createApprove",
    data,
  });
};

export const getAllPriject = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/tree/list",
    data,
  });
};

export const addTree = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/tree/add",
    data,
  });
};

export const delTree = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/tree/delete",
    data,
  });
};

export const changeTree = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/tree/update",
    data,
  });
};

export const changeTreeBody = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/tree/move",
    data,
  });
};

export const getAllCom = (data) => {
  return service({
    method: "POST",
    url: "/apt/vendorMap/list",
    data,
  });
};

export const getTable = (data) => {
  return service({
    method: "POST",
    url: "/apt/vendorMap/pageList",
    data,
  });
};

export const submitEditProjectData = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/update",
    data,
  });
};

export const DelProjectData = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/delete",
    data,
  });
};

export const submitAddProjectData = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/create",
    data,
  });
};

export const getProjectMapAndData = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/list",
    data,
  });
};

export const getPersonData = (data) => {
  return service({
    method: "POST",
    url: "/apt/emp/pageList",
    data,
  });
};

export const getContractData = (data) => {
  return service({
    method: "POST",
    url: "/apt/contract/pageList",
    data,
  });
};

export const changeState = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/changeOnSite",
    data,
  });
};

export const getContractMapData = (data) => {
  return service({
    method: "POST",
    url: "/apt/contract/pageList",
    data,
  });
};

export const getRYFBData = (data) => {
  return service({
    method: "POST",
    url: "/apt/emp/empTotal",
    data,
  });
};

export const getRYFBMapData = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/list",
    data,
  });
};

export const getCJData = (data) => {
  return service({
    method: "POST",
    url: "/apt/vendorMap/pageList",
    data,
  });
};

export const getCJBottomData = (data) => {
  return service({
    method: "POST",
    url: "/apt/vendorMap/queryContracts",
    data,
  });
};

export const EchartsDataGYS = (data) => {
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      total: 123,
      data: [
        {
          projectsName: "广东石化炼化一体化项目",
          vendorNum: 13,
        },
        {
          projectsName: "内蒙大全十万吨多晶硅数字化交付",
          vendorNum: 132,
        },
        {
          projectsName: "永祥能源科技晶硅数字化交付项目",
          vendorNum: 233,
        },
      ],
    });
  });
};

export const applySubmit = (data) => {
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [
        {
          applicant: "张三",
          applyTime: "2022-12-13",
          projectName: "内蒙大全十万吨多晶硅数字化交付",
        },
        {
          applicant: "张三",
          applyTime: "2023-02-13",
          projectName: "广东石化炼化一体化项目",
        },
      ],
    });
  });
};

export const applyPersonData = (data) => {
  return service({
    method: "POST",
    url: "/apt/approve/chooseAppUser",
    data,
  });
};

export const applyProcess = (data) => {
  return service({
    method: "POST",
    url: "/apt/emp/listGroupUser",
    data,
  });
};

export const applyPersonDBFN = (data) => {
  return service({
    method: "POST",
    url: "/apt/approve/queryApprove",
    data,
  });
};

export const applyPersonTG = (data) => {
  return service({
    method: "POST",
    url: "/apt/approve/doApprove",
    data,
  });
};

export const getUserRole = (data) => {
  return service({
    method: "POST",
    url: "/apt/emp/empInfo",
    data,
  });
};

export const EchartsDataREFB = (data) => {
  return service({
    method: "POST",
    url: "/apt/emp/empInProjChart",
    data,
  });
};

export const getSubmitComment = (data) => {
  return service({
    method: "POST",
    url: "/apt/contract/submitComment",
    data,
  });
};

export const EchartsDataXMFB = (data) => {
  return service({
    method: "POST",
    url: "/apt/projMap/projChart",
    data,
  });
};

export const checkAllDataPerson = (data) => {
  console.log(data);
  return service({
    method: "POST",
    url: "/apt/emp/empTotalInfo",
    data,
  });
};
